package com.fpd.enums;

/**
 * 联系人类型
 *
 * @author Monster
 */
public enum RelationTypeEnum {
	FATHER("1", "父亲"),
	MATHER("2", "母亲"),
	BROTHERSISTER("3", "兄弟姐妹"),
	PO("4", "配偶"),
	FRIEND("5", "朋友/同事"),
	ELSE("6", "其他亲属"),
	OTHER("8", "其他"),
	SON("7", "子女");

    private String value;
    private String name;

    RelationTypeEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByValue(String value) {
        for (RelationTypeEnum ate : RelationTypeEnum.values()) {
            if (ate.getValue().equals(value)) {
                return ate.getName();
            }
        }
        return "";
    }
}
